<template>
  <div>
    <van-cell
      :title="info.title"
      :to="{
        name:'detail',
        params: {
          // 属性名：路由路径中设计的动态参数名称
          articleId: info.art_id
        }
      }"
    >
      <template>
        <van-image
          v-if="info.cover.type === 1"
          class="oneimg"
          :src="info.cover.images[0]"
        />
      </template>
      <template #label>
        <div
          v-if="info.cover.type === 3"
          class="img"
        >
          <van-image
            v-for="(item,index) in info.cover.images"
            :key="index"
            width="100"
            height="100"
            :src="item"
          />
        </div>
        <span>{{ info.aut_name }}</span>
        <span class="comment">{{ info.collect_count }}评论</span>
        <span>{{ info.pubdate | relativeTime }}</span>
      </template>
    </van-cell>
  </div>
</template>

<script>
export default {
  props: {
    info: {
      type: Object,
      required: true
    }
  },
  data() {
    return {

    }
  },

  created() {
    // console.log(this.info)
  },

  methods: {

  }
}
</script>

<style scoped lang='less'>
.img {
  display: flex;
  justify-content: space-between;
}
.oneimg {
  width: 232px;
  height: 146px;
}
.comment {
  padding: 0 20px;
}
</style>
